From c56086917617fbaf9fa233e945fb02216247e056 Mon Sep 17 00:00:00 2001 From: Fabien Antoine Date: Sat, 6 May 2017 14:44:41 +0200 Subject: [PATCH] Added test --- tests/git.rs | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tests/git.rs b/tests/git.rs index 5b4ae5059..07c4996cb 100644 --- a/tests/git.rs +++ b/tests/git.rs @@ -290,6 +290,61 @@ fn cargo_compile_with_nested_paths() { execs().with_stdout("hello world\n")); } +#[test] +fn cargo_compile_with_malformed_nested_paths() { + let git_project = git::new("dep1", |project| { + project + .file("Cargo.toml", r#" + [project] + + name = "dep1" + version = "0.5.0" + authors = ["carlhuda@example.com"] + + [lib] + + name = "dep1" + "#) + .file("src/dep1.rs", r#" + pub fn hello() -> &'static str { + "hello world" + } + "#) + .file("vendor/dep2/Cargo.toml", r#" + !INVALID! + "#) + }).unwrap(); + + let p = project("parent") + .file("Cargo.toml", &format!(r#" + [project] + + name = "parent" + version = "0.5.0" + authors = ["wycats@example.com"] + + [dependencies.dep1] + + version = "0.5.0" + git = '{}' + + [[bin]] + + name = "parent" + "#, git_project.url())) + .file("src/parent.rs", + &main_file(r#""{}", dep1::hello()"#, &["dep1"])); + + p.cargo_process("build") + .exec_with_output() + .unwrap(); + + assert_that(&p.bin("parent"), existing_file()); + + assert_that(process(&p.bin("parent")), + execs().with_stdout("hello world\n")); +} + #[test] fn cargo_compile_with_meta_package() { let git_project = git::new("meta-dep", |project| { -- 2.30.2